<?php
namespace app\pos_v1\validate;
use think\Validate;
class SellPosPAY_Refund extends Validate
{
    protected $rule = [
        'dbid' => 'require|string', //POS销售单号
        "client_sn" => "require|string",//商户系统支付单号必填
        "refund_ty" => "require|integer|in:1,2",//退款方式_1单项退款2整单退款
        "refund_sn" => "string",//扫客户手机退款码refund_ty=1时必填
        "operator" => "require|string",//门店操作员
    ];
    protected $message = [
        'dbid' => 'POS销售单号-dbid',
        "client_sn" => "商户系统支付单号必填-client_sn",
        "refund_ty" => "退款方式_1单项退款2整单退款-refund_ty",
        "refund_sn" => "扫客户手机退款码-refund_sn",
        "operator" => "门店操作员-operator",//门店操作员
        // 'user_type.require' => '帐号类型必须', //帐号类型admin总部agent代理user一般用户
        // 'user_type.in' => '帐号类型仅限:user,agent,admin', //帐号类型admin总部agent代理user一般用户
    ];
    // 自定义验证方法-帐号类型
    protected function userType($value, $rule, $requestdb)
    {
        // dump($value);
        // dump($rule);
        // dump($requestdb);
    }
}
